<template>
    <div class="lately-message">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <el-button style="padding: 3px 0" type="text">
                    <i class="el-icon-s-comment"></i>
                    最新留言
                </el-button>
            </div>
            <div v-for="o in heads" class="text-item">
                <div class="message-left inline">
                    <el-image class="message-left-img" :src="o.img" fit="fill"></el-image>
                </div>
                <div class="message-right inline">
                    {{o.message}}
                </div>
                <el-divider></el-divider>
            </div>
        </el-card>
    </div>
</template>

<script>
    export default {
        name: "LatelyMessage",
        data() {
            return {
                heads: [
                    {message: '我有一头小毛驴,我从来都不骑,有一天我心血来潮骑它去赶集,我从来都不骑我从来都不骑我从来都不骑', img: require('../assets/head-1.jpg')},
                    {message: '我从来都不骑', img: require('../assets/head-2.jpg')},
                    {message: '有一天我心血来潮骑它去赶集', img: require('../assets/head-3.jpg')},
                    {message: '有一天我心血来潮骑它去赶集', img: require('../assets/head-4.jpg')},
                    {message: '有一天我心血来潮骑它去赶集', img: require('../assets/head-5.jpg')}
                ]
            }
        }
    }
</script>

<style scoped>
    .lately-message {
        margin-top: 20px;
    }

    .message-left {
        height: 50px;
        width: 50px;
    }

    .inline {
        display: inline-block;
        vertical-align: top;
    }

    .message-left-img {
        height: 50px;
        width: 50px;
        overflow: visible;

    }

    .message-right {
        height: 50px;
        margin-left: 10px;
        line-height: 50px;
        font-size: 12px;
        width: 100%;
        /*background-color: aqua;*/
    }

    .text-item{
        width: 95%;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
</style>